package com.cetc.lambda;

import java.util.Comparator;

/**
 * @Classname Person
 * @Date 2022/11/26 17:26
 * @Created by louzhuangxi
 */
public class Person {
    private String name;
    public int age;

    public Person() {
        System.out.println("调用了无参构造");
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private Person(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 展示
     */
    public void show() {
        System.out.println("我是一个人");
    }

    /**
     * 展示民族
     *
     * @param nation
     */
    private static void showNation(String nation) {
        System.out.println("我的国籍是：" + nation);
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Person{");
        sb.append("name='").append(name).append('\'');
        sb.append(", age=").append(age);
        sb.append('}');
        return sb.toString();
    }

}
